/**
 * Created by zheng on 2018/1/17.
 */


var express = require('express');
var router = express.Router();
var blogDocumentController = require('../controller/BlogDocumentController');

router.get('/', (req, res, next) => {
  blogDocumentController.getAllBlogDocument(req, res);
}).get('/:_id', (req, res, next) => {
  blogDocumentController.getBlogDocumentById(req, res);
}).get('/doclist/:page', (req, res, next) => {
  blogDocumentController.getBlogDocumentWithPageNumber(req, res);
}).get('/doclist/next/:_id', (req, res, next) => {
  blogDocumentController.getBlogDocumentWithNextPage(req,res);
}).get('/doclist/pre/:_id', (req, res, next) => {
  blogDocumentController.getBlogDocumentWithPrePage(req,res);
}).post('/', (req, res, next) => {
  blogDocumentController.addBlogDocument(req, res);
}).post('/transfer/tmp', (req, res, next) => {
  blogDocumentController.transferImage(req, res);
}).put('/', (req, res, next) => {
  blogDocumentController.updateBlogDocument(req, res);
}).delete('/:_id', (req, res, next) => {
  blogDocumentController.deleteBlogDocumentById(req, res);
});

module.exports = router;
